package com.uiao.stone.service.serviceImpl;

import com.uiao.stone.common.config.StrategyFactory;
import com.uiao.stone.common.enums.OrderType;
import com.uiao.stone.data.User;
import com.uiao.stone.data.UserExample;
import com.uiao.stone.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author cuihao
 * @date 2017/12/12
 */
@Service
@Transactional(rollbackFor = Throwable.class)
public class UserServiceImpl implements UserService {

    /*@Autowired
    private UserMapper userMapper;*/

    @Override
    public User findUserById(Integer userId) {
        return null;
        /*User user = userMapper.selectByPrimaryKey(userId);
        return user;*/
    }

    @Override
    public List<User> listUsers() {
        UserExample userExample = new UserExample();
        /*List<User> users = userMapper.selectByExample(userExample);
        return users;*/
        return null;
    }

    @Override
    public void order() {
        StrategyFactory.getStrategy(OrderType.A).order();
        StrategyFactory.getStrategy(OrderType.B).order();
    }
}
